package agh.tk.markuptranslation;

public class TableHeader extends AbstractComponent
{
	/**
	 * 
	 * @param leftChild - Komorka
	 * @param rightChild - Reszta wiersza
	 */
	public TableHeader(IComponent leftChild, IComponent rightChild) 
	{
		super(leftChild, rightChild) ;
	}
	@Override
	public String toDokuWiki()
	{
		return super.toDokuWiki("^") ;
	}
	@Override
	public String toMediaWiki()
	{
		return null ;
	}
	
	@Override
	public String toHTML() {
		StringBuilder result = new StringBuilder();
		if(leftChild == null)
			return "";
		result.append("<th>");
		result.append(leftChild.toHTML());
		result.append("</th>");
		if(rightChild!=null)
			result.append(rightChild.toHTML());
		return result.toString();
	}
	
	@Override
	public String toTxt2tags()
	{
		return super.toTxt2tags("|") ;
	}
	
	
}
